#pragma once
#include <windows.h>
#include <ole2.h>
#include "CComm.h"

class CDataObject: public IDataObject, public CRefCount
{
private:
	LPFORMATETC m_pFormatEtc;
	LPSTGMEDIUM m_pStgMedium;
	DWORD m_cDataCount;

public:
	CDataObject();
	virtual ~CDataObject();

	//IUnknown members that delegate to m_pUnkOuter.
	virtual HRESULT __stdcall QueryInterface(REFIID iid, LPVOID* ppvid);
	virtual ULONG __stdcall AddRef();
	virtual ULONG __stdcall Release();

	/* IDataObject methods */    
	virtual HRESULT __stdcall GetData(LPFORMATETC,  LPSTGMEDIUM);
	virtual HRESULT __stdcall GetDataHere(LPFORMATETC, LPSTGMEDIUM);
	virtual HRESULT __stdcall QueryGetData(LPFORMATETC);
	virtual HRESULT __stdcall GetCanonicalFormatEtc(LPFORMATETC, LPFORMATETC);
	virtual HRESULT __stdcall SetData(LPFORMATETC, LPSTGMEDIUM, BOOL);
	virtual HRESULT __stdcall EnumFormatEtc(DWORD, LPENUMFORMATETC*);
	virtual HRESULT __stdcall DAdvise(FORMATETC*, DWORD, LPADVISESINK, LPDWORD);
	virtual HRESULT __stdcall DUnadvise(DWORD);
	virtual HRESULT __stdcall EnumDAdvise(LPENUMSTATDATA*);

};